using Scm.Jwt.Util;
using Scm.Api.Controllers;
using Scm.Api.Dto;
using Orm.Entities;
using Scm.Orm.Helper;

namespace Scm.Test
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMethod1()
        {
            Console.WriteLine("this is 324");
        }

        [TestMethod]
        public void TestPath()
        {
            var path = System.IO.Directory.GetCurrentDirectory();
            Console.WriteLine(path);
        }

        [TestMethod]
        public void RandomString()
        {
            for (int i = 0; i < 100; i++)
            {
                var random = StringUtil.GetRandomStr(8);
                Console.WriteLine(random);
            }
        }

        [TestMethod]
        public void GenJwtSecretTest()
        {
            for (int i = 0; i < 100; i++)
            {
                var random = StringUtil.GenJwtSecret();
                Console.WriteLine(random);
            }
        }

        [TestMethod]
        public void MD5Test()
        {
            for (int i = 0; i < 100; i++)
            {
                var random = StringUtil.MD5String(StringUtil.GetRandomStr(5), i % 2 == 0);
                Console.WriteLine(random);
            }
        }

        [TestMethod]
        public void ObjectCopyTest()
        {
            var User1 = new ScmUser
            {
                UserName = "Test1",
                Password = "Test1"
            };
            var User2 = new ScmUser();
            User2 = ObjectHandler.Copy(User2, User1);
            Console.WriteLine(User2);
        }
    }
}